package com.me.brainlessbirds.actors.map;

import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.me.brainlessbirds.Assets;
import com.me.brainlessbirds.screens.GameScreen;

public class Cloud extends Actor
{
	private TextureRegion	rgnCloud	= new TextureRegion();
	private float			speed		= 10f;

	public Cloud(int num, float x, float y)
	{
		switch (num)
		{
			case 1:
				this.rgnCloud = new TextureRegion(Assets.get().textureCloud1);
				setSize(GameScreen.WIDTH / 2, GameScreen.HEIGHT / 4);
				break;

			case 2:
				this.rgnCloud = new TextureRegion(Assets.get().textureCloud2);
				setSize(GameScreen.WIDTH / 4, GameScreen.HEIGHT / 6);
				break;

			case 3:
				this.rgnCloud = new TextureRegion(Assets.get().textureCloud3);
				setSize(GameScreen.WIDTH / 4, GameScreen.HEIGHT / 6);
				break;
		}
		setOrigin(getWidth() / 2, getHeight() / 2);
		setPosition(x, y);
	}

	public TextureRegion getTexture()
	{
		return this.rgnCloud;
	}

	@Override
	public void act(float delta)
	{
		setX(getX() + this.speed * delta);
		if (getX() > GameScreen.LEVEL_WIDTH)
		{
			setX(-(getWidth()));
		}
	}
}
